<?php
defined('IN_TS') or die('Access Denied.');
	/* 
	 * 用户被跟随
	 */

	$userid = intval($_GET['userid']);
	
	$strUser = $DB->once_fetch_assoc("select * from ".dbprefix."app_user_info where userid='".$userid."'");
	
	if($strUser == '') header("Location: index.php");
	
	//头像
	if($strUser['face'] != ''){
		$menu = substr($userid,0,1);
		$strUser['bigface'] = 'data/uploadfile/user/'.$menu.'/'.$userid.'/'.$userid.'_98.jpg';
	}else{
		$strUser['bigface'] = 'data/uploadfile/user/default/n_default.gif';
		$strUser['face']	= 'data/uploadfile/user/default/noavatar.gif';
	}
	//城市 
	if($strUser['cityid'] != '0'){
		$strUser['city'] = $DB->once_fetch_assoc("select * from ".dbprefix."app_location_city where cityid='".$strUser['cityid']."'");
	}
	
	//他跟随的用户
	$followUsers = $DB->fetch_all_assoc("select userid_follow from ".dbprefix."app_user_follow where userid='$userid'");
	
	if(is_array($followUsers)){
		foreach($followUsers as $item){
			$arrFollowUser[] =  getUserData($item['userid_follow']);
		}
	}

	$title = $strUser['username'].'关注的人';
	include TmooTemplate("follow");

	//通过uid获取用户数据
	function getUserData($userid){
	
		global $DB;
		$userData = $DB->once_fetch_assoc("select * from ".dbprefix."app_user_info where userid='$userid'");
		
		//同城
		if($userData['cityid'] != '0'){
			$userData['city'] = $DB->once_fetch_assoc("select * from ".dbprefix."app_location_city where cityid='".$userData['cityid']."'");
		}else{
			$userData['city']['cityname']='火星';
		}
		
		//头像
		if($userData['face'] == ''){
			$userData['face']	= 'data/uploadfile/user/default/noavatar.gif';
		}
		
		return $userData;
		
	}